import config from "./config";

uni.addInterceptor("request", {
	invoke(args) {
		console.log('interceptor-invoke')
		// request 触发前拼接 url
		args.url = config.baseUrl + args.url
	},
	success(args) {
		// 请求成功后，修改code值为1
		console.log('interceptor-success')
		args.data.code = 200
	},
	fail(err) {
		console.log('interceptor-fail', err)
	},
	complete(res) {
		console.log('interceptor-complete', res)
	}
})